<template>
  <div class="table-box">
    <table class="table" cellspacing="0">
      <tr class="line">
        <td>
          <span class="font-family">&nbsp;&nbsp;&nbsp;&nbsp;订单详情</span>
        </td>
        <td width="150" align="center">
          <span class="font-family">收货人</span>
        </td>
        <td width="150" align="center">
          <span class="font-family">支付金额</span>
        </td>
        <td width="150" align="center">
          <span class="font-family">订单状态</span>
        </td>
        <td width="200" align="center">
          <span class="font-family">操作</span>
        </td>
      </tr>
    </table>
    <div class="order-list" v-for="item in orderData">
      <div class="tb-head">
        <div class="tb-head-left">
          <div class="overOne" :title="item.create_time">
            {{ item.create_time }}
          </div>
          <div class="overOne" :title="item.factory_name">
            {{ item.factory_name }}
          </div>
          <div class="overOne" :title="`订单号:${item.order_no}`">
            订单号:{{ item.order_no }}
          </div>
          <div class="overOne" :title="`支付流水号:${item.pay_no}`">
            支付流水号:{{ item.pay_no }}
          </div>
        </div>
        <div class="tb-head-right">
          <Customer :title="`工厂客服`" :customer="item.factoryCustomer" />
        </div>
      </div>
      <table class="table border" border="0" cellspacing="0">
        <tr v-for="goods in item.goods">
          <td>
            <div class="first-td">
              <div class="first-td-left">
                <div class="order-img">
                  <img v-lazy="publicUrl(goods.img)" />
                </div>
                <div class="center">
                  <p class="overOneSpec text-blod" :title="goods.title">{{ goods.title }}</p>
                  <p class="overOneSpec" :title="goods.production_no">生产订单：{{ goods.production_no }}</p>
                  <p class="overOneSpec small-color" :title="goods.promotion_text">
                    {{ goods.promotion_text }}
                  </p>
                </div>

                <div class="right overOne">
                  {{ goods.fabric }}
                </div>
              </div>

              <div class="first-td-right">
                <div class="overOne">货望:{{ goods.cargo_day }}天</div>
                <div class="overOne">数量:{{ goods.total }}</div>
                <div class="overOne">晚期:{{ goods.late_stage }}天</div>
              </div>
            </div>
          </td>

          <td width="150" align="center">
            <div class="consignee">
              <img v-lazy="publicUrl(goods.portrait)" />
              <span>{{ goods.user_name }}</span>
            </div>
          </td>
          <td width="150" align="center">
            <div class="price">
              <div class="top overOne">￥{{ twoFixed(goods.price) }}</div>
              <div class="dir"></div>
              <div class="bottom overOne">{{ goods.pay_type }}</div>
            </div>
          </td>
          <td width="150" align="center">
            <span class="status"
              >{{ goods.order_status }}:<span class="green">{{
                goods.order_stage
              }}</span></span
            >
          </td>
          <td width="200">
            <slot name="operation" :row="[]"></slot>
          </td>
        </tr>

       
      </table>
      <!-- <table  class="statistics-table"   border="0" cellspacing="0"  v-show="showTax">
        <tr > -->
          <!-- <td> -->
            <!-- orderPrice:number;     //订单金额
        taxPrice:number;       //税费
        payPrice:number;       //支付金额
        discount:number;       //优惠金额 -->
        <div class="td-row">
              <span>订单金额:&nbsp;{{ twoFixed(item.orderPrice) }}</span>
              <span>税费:&nbsp;{{ twoFixed(item.taxPrice) }}</span>
              <span>优惠金额:&nbsp;{{ twoFixed(item.discount) }}</span>
              <span>电子现金券抵扣:&nbsp;{{ twoFixed(item.eCash) }}</span>
              <span>支付金额:&nbsp;{{ twoFixed(item.payPrice) }}</span>
        </div>
          <!-- </td> -->
         
        <!-- </tr> -->
       
      <!-- </table> -->
    </div>
  </div>
</template>
<script setup lang="ts" name="">
import { publicUrl, twoFixed } from "@/utils/util";
import { OrderData } from "../../interface";
import Customer from "@/components/Customer/index.vue";

interface Props {
  orderData?: Array<OrderData>;
  showTax?:boolean;
}
const props = withDefaults(defineProps<Props>(), {
  orderData: () => [],
  showTax:true
});

// const allPrice  
</script>
<style scoped lang="scss">
@import "./index.scss";
</style>
